package com.huage_08.listener;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import javax.servlet.annotation.WebListener;

@WebListener
public class ListenerDemo1 implements ServletContextListener {
    @Override
    public void contextInitialized(ServletContextEvent servletContextEvent) {
        //加载初始化资源
        System.out.println("ServletContext被创建...");
    }

    @Override
    public void contextDestroyed(ServletContextEvent servletContextEvent) {

        //释放资源
        System.out.println("ServletContext被摧毁...");
    }
}
